package xyz.ddlnt.user.usr.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.ddlnt.commonutil.result.Result;
import xyz.ddlnt.model.vo.TechnologyInfoVO;
import xyz.ddlnt.serviceusrclient.client.TechnologyFeignClient;

import java.util.List;

/**
 * @author ZZULI_SE 210910
 * @data 2025/5/5 1:00
 */
@Slf4j
@Tag(name = "科目接口测试")
@RequestMapping("/technology")
@RestController
public class TechnologyController {

    @Resource
    private TechnologyFeignClient technologyFeignClient;


    @Operation(summary = "根据类别id获取科目信息")
    @GetMapping("/selectByCategoryId/{categoryId}")
    Result<List<TechnologyInfoVO>> selectByCategoryId(@PathVariable Long categoryId) {
        return technologyFeignClient.selectByCategoryId(categoryId);
    }


    @Operation(summary = "根据科目id获取科目信息")
    @GetMapping("/selectByTechnologyId/{technologyId}")
    public Result<TechnologyInfoVO> selectByTechnologyId(@PathVariable Long technologyId) {
        return technologyFeignClient.selectByTechnologyId(technologyId);
    }
}
